// 中间件
export default defineNuxtRouteMiddleware((to, from) => {
  //console.log(to.path)
  let passUrl = ['/login', '/about']

  if (!passUrl.includes(to.path)) {
    let token = "";
    //客户端渲染
    if (import.meta.client) {
      token = localStorage.getItem("token");
    }

    if (!token) {
      return navigateTo({
        path: "/login"
      });
    }

  }
})